package com.mylibrary.dao;

import com.mylibrary.domain.ReaderInfo;
import com.mylibrary.domain.ReaderLogin;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;
import java.util.Set;

public interface ReaderInfoDao {
    @Insert("insert into reader_info(username,password,realName," +
            "sex,birthday,address,tel,email,registerDate) " +
            "value(#{username},#{password},#{realName}," +
            "#{sex},#{birthday},#{address},#{tel},#{email},#{registerDate})")
    int insertOne(ReaderInfo readerInfo);

    @Select("select username from reader_info")
    Set<String> selectAllUserName();
    @Select("select username,password from reader_info ")
    List<ReaderLogin> selectToLogIn();


}
